package com.panshi.service.impl;

import com.panshi.entity.*;
import com.panshi.service.SysClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class SysClientServiceFallbackFactory implements FallbackFactory<SysClientService> {

    @Override
    public SysClientService create(Throwable cause) {
        System.out.println("系统服务降级 ------------》");
        return new SysClientService() {
            @Override
            public SysAdminT getAdminById(int id) {
                return new SysAdminT();
            }

            @Override
            public SysAdminApi getAdminEmail(String email) {
                return new SysAdminApi();
            }

            @Override
            public SysAdminApi getAdminPhone(String phone) {
                return new SysAdminApi();
            }

            @Override
            public Boolean sysUserDelRole(SysUserRoleT sysUserRoleT) {
                return false;
            }

            @Override
            public List<SysAdminApi> getAdminAll() {
                return new ArrayList<>();
            }

            @Override
            public List<SysAdminT> getAdminLikeName(String adminname, String status, int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public SysFunctionT getFunctionId(int functionId) {
                return new SysFunctionT();
            }

            @Override
            public List<SysFunctionT> getFunIsNot(ArrayList<Integer> notList) {
                return new ArrayList<>();
            }

            @Override
            public List<SysRoleFunctionT> getRoleFunctionID(int roleId) {
                return new ArrayList<>();
            }

            @Override
            public SysRoleT getRole(int roleId) {
                return new SysRoleT();
            }

            @Override
            public SysUserRoleT userRole(int adminId) {
                return new SysUserRoleT();
            }

            @Override
            public Boolean sysUserAddRole(SysUserRoleT sysUserRoleT) {
                return false;
            }

            @Override
            public List<SysRoleT> roleAll() {
                return new ArrayList<>();
            }

            @Override
            public List<SysRoleT> rolelimit(String rolename, int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public Boolean roleFunAdd(SysRoleFunctionT sysRoleFunctionT) {
                return false;
            }

            @Override
            public Boolean roleFunDel(SysRoleFunctionT sysRoleFunctionT) {
                return false;
            }

            @Override
            public List<SysFunctionT> getFunAll() {
                return new ArrayList<>();
            }

            @Override
            public List<SysFunctionT> getLimitFun(int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public SysFunctionT funname(String funname) {
                return new SysFunctionT();
            }

            @Override
            public SysFunctionT funurl(String funurl) {
                return new SysFunctionT();
            }

            @Override
            public Boolean funAdd(SysFunctionT sysFunctionT) {
                return false;
            }

            @Override
            public Boolean funByIdDel(int funid) {
                return false;
            }
        };
    }
}
